<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateOrderCartInfosTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('order_cart_infos', function (Blueprint $table) {
            $table->id()->comment('订单购物车关联表');
            $table->integer('cart_id')->index()->comment('购物车id');
            $table->integer('order_id')->index()->comment('订单_id');
            $table->integer('product_id')->index()->comment('商品id');
            $table->string('unique')->comment('唯一id');
            $table->json('cart_info')->comment('购买东西的详细信息');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('order_cart_infos');
    }
}
